package com.aspose.cells;

public class CustomFilterCollection extends CollectionBase {
   private boolean b;

   void a(CustomFilterCollection var1) {
      this.b = var1.b;

      for(int var2 = 0; var2 < var1.getCount(); ++var2) {
         CustomFilter var3 = var1.get(var2);
         CustomFilter var4 = new CustomFilter();
         var4.a(var3);
         com.aspose.cells.b.a.a.ze.a(this.a, (Object)var4);
      }

   }

   public boolean getAnd() {
      return this.b;
   }

   public void setAnd(boolean value) {
      this.b = value;
   }

   void a(CustomFilter var1) {
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
   }

   public CustomFilter get(int index) {
      return (CustomFilter)this.a.get(index);
   }

   boolean a(Object var1, boolean var2) {
      for(int var3 = 0; var3 < this.getCount(); ++var3) {
         CustomFilter var4 = this.get(var3);
         if (this.a(var1, var4.getFilterOperatorType(), var4.getCriteria(), var2)) {
            if (!this.getAnd()) {
               return true;
            }
         } else if (this.getAnd()) {
            return false;
         }
      }

      if (this.getAnd()) {
         return true;
      } else {
         return false;
      }
   }

   private boolean a(Object var1, int var2, Object var3, boolean var4) {
      if (var1 == null) {
         switch(var2) {
         case 2:
            return var3 == null;
         case 4:
            return var3 != null;
         default:
            return false;
         }
      } else {
         switch(var2) {
         case 0:
            Object var12 = zmc.a(var1, var3, "<=", var4);
            if (var12 instanceof Boolean) {
               return (Boolean)var12;
            }

            return false;
         case 1:
            Object var11 = zmc.a(var1, var3, "<", var4);
            if (var11 instanceof Boolean) {
               return (Boolean)var11;
            }

            return false;
         case 2:
            if (var3 == null) {
               return var1 == null;
            } else {
               String var5 = com.aspose.cells.b.a.zr.a(var3).toLowerCase();
               var5 = com.aspose.cells.b.a.zv.a(var5, "?", ".?");
               var5 = com.aspose.cells.b.a.zv.a(var5, "*", ".*");
               com.aspose.cells.b.a.g.a.ze var6 = new com.aspose.cells.b.a.g.a.ze("^" + var5 + "$");
               if (var6.d(com.aspose.cells.b.a.zr.a(var1).toLowerCase())) {
                  return true;
               }

               return false;
            }
         case 3:
            Object var9 = zmc.a(var1, var3, ">", var4);
            if (var9 instanceof Boolean) {
               return (Boolean)var9;
            }

            return false;
         case 4:
            if (var3 == null) {
               return var1 != null;
            } else {
               String var7 = com.aspose.cells.b.a.zr.a(var3).toLowerCase();
               var7 = com.aspose.cells.b.a.zv.a(var7, "?", ".?");
               var7 = com.aspose.cells.b.a.zv.a(var7, "*", ".*");
               com.aspose.cells.b.a.g.a.ze var8 = new com.aspose.cells.b.a.g.a.ze("^" + var7 + "$");
               if (!var8.d(com.aspose.cells.b.a.zr.a(var1).toLowerCase())) {
                  return true;
               }

               return false;
            }
         case 5:
            Object var10 = zmc.a(var1, var3, ">=", var4);
            if (var10 instanceof Boolean) {
               return (Boolean)var10;
            }

            return false;
         default:
            return true;
         }
      }
   }

   boolean a(Cell var1, boolean var2) {
      for(int var3 = 0; var3 < this.getCount(); ++var3) {
         CustomFilter var4 = this.get(var3);
         if (this.a(var1, var4.getFilterOperatorType(), var4.getCriteria(), var2)) {
            if (!this.getAnd()) {
               return true;
            }
         } else if (this.getAnd()) {
            return false;
         }
      }

      if (this.getAnd()) {
         return true;
      } else {
         return false;
      }
   }

   private boolean a(Cell var1, int var2, Object var3, boolean var4) {
      if (var1 != null && var1.c.c != 0) {
         switch(var2) {
         case 0:
            Object var12 = zmc.a(var1.getValue(), var3, "<=", var4);
            if (var12 instanceof Boolean) {
               return (Boolean)var12;
            }

            return false;
         case 1:
            Object var11 = zmc.a(var1.getValue(), var3, "<", var4);
            if (var11 instanceof Boolean) {
               return (Boolean)var11;
            }

            return false;
         case 2:
            if (var3 == null) {
               return var1.c.c == 0;
            } else {
               String var5 = com.aspose.cells.b.a.zr.a(var3).toLowerCase();
               var5 = com.aspose.cells.b.a.zv.a(var5, "?", ".?");
               var5 = com.aspose.cells.b.a.zv.a(var5, "*", ".*");
               com.aspose.cells.b.a.g.a.ze var6 = new com.aspose.cells.b.a.g.a.ze("^" + var5 + "$");
               if (var6.d(var1.j().toLowerCase())) {
                  return true;
               }

               return false;
            }
         case 3:
            Object var9 = zmc.a(var1.getValue(), var3, ">", var4);
            if (var9 instanceof Boolean) {
               return (Boolean)var9;
            }

            return false;
         case 4:
            if (var3 != null) {
               String var7 = com.aspose.cells.b.a.zr.a(var3).toLowerCase();
               var7 = com.aspose.cells.b.a.zv.a(var7, "?", ".?");
               var7 = com.aspose.cells.b.a.zv.a(var7, "*", ".*");
               com.aspose.cells.b.a.g.a.ze var8 = new com.aspose.cells.b.a.g.a.ze("^" + var7 + "$");
               if (!var8.d(var1.j().toLowerCase())) {
                  return true;
               }

               return false;
            }

            return var1 != null && !"".equals(var1.getStringValue(0));
         case 5:
            Object var10 = zmc.a(var1.getValue(), var3, ">=", var4);
            if (var10 instanceof Boolean) {
               return (Boolean)var10;
            }

            return false;
         default:
            return true;
         }
      } else {
         switch(var2) {
         case 2:
            return var3 == null;
         case 4:
            return var3 != null;
         default:
            return false;
         }
      }
   }
}
